package face.pay.web.terminal;

import face.pay.common.enterprise.service.IterminalBaseService;
import face.pay.entity.TerminalInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.util.ResultMessage;
import face.pay.util.page.PageData;
import face.pay.util.page.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: zkj
 * @Date: 2019/7/16 17:36
 * @Description:
 */
@Controller
@RequestMapping("/enterprise_terminal")
public class EnterpriseTerminalController {

    @Autowired
    private IterminalBaseService iterminalBaseService;

    /**
     * 商家设备列表
     * @return
     */
    @RequestMapping("/list")
    public String manager(){

        return  "enterprise/terminal_list";
    }



   /* *//**
     * 设备修改
     * @param terminalInfo
     * @param loginUser
     * @return
     *//*
    @ResponseBody
    @RequestMapping("/edit")
    public ResultMessage edit(TerminalInfo terminalInfo,@CurrentUser UserInfo loginUser){
        return  iterminalBaseService.edit(terminalInfo,loginUser);
    }*/

    @ResponseBody
    @RequestMapping("/queryData")
    public PageData<TerminalInfo> queryPage(TerminalInfo terminalInfo, PageParam pageParam, @CurrentUser UserInfo loginUser){

        terminalInfo.setUserId(loginUser.getId());
        terminalInfo.setOemId(loginUser.getOemId());
        return  iterminalBaseService.queryPage(terminalInfo,pageParam,loginUser);
    }


    @ResponseBody
    @RequestMapping("/storeBing")
    public ResultMessage storeBing(TerminalInfo terminalInfo,@CurrentUser UserInfo loginUser){
        return  iterminalBaseService.storeBing(terminalInfo,loginUser);
    }

}
